<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//Dth XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>山西煤炭现货公路交易系统客户端</title>
 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
     <!-- daterange picker -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/ionicons/css/ionicons.min.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
     <!-- DataTables -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.css">
   <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
	<!-- jQuery 2.1.4 -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<!-- Bootstrap 3.3.5 -->
    <script src="<s:url value="/resources"/>/adminlte/bootstrap/js/bootstrap.min.js"></script>
	 <!-- AdminLTE App -->
    <script src="<s:url value="/resources"/>/adminlte/dist/js/app.min.js"></script>
    <!-- Select2 -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/select2/select2.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
    
         <script src="<s:url value="/resources"/>/adminlte/default.js"></script>
         
      <script src="<s:url value="/resources"/>/adminlte/default_settlement.js"></script>
      
      <!-- 百度地图 -->
   <style type="text/css">
	body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/library/AreaRestriction/1.2/src/AreaRestriction_min.js"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=pWpfYkCbEHczf7UNja4U8FbVnk99U4k8"></script>
</head>
<body class="skin-blue sidebar-mini">
<input type="hidden"  id="falseload">
    <link href="<s:url value="/resources"/>/map/css/map.css" rel="stylesheet" type="text/css">
   <link href="<s:url value="/resources"/>/map/css/style.css" rel="stylesheet" type="text/css">
 
<link href="<s:url value="/resources"/>/map/css/style-shaixuan.css" rel="stylesheet" type="text/css">
 
<div id="allmap" style="width:100%;height: 100%;"></div>      
      <script type="text/javascript">
	// 百度地图API功能
	
	/* map.setCurrentCity("大同市");          // 设置地图显示的城市 此项是必须设置的
	var b = new BMap.Bounds(new BMap.Point(112.175012,40.047862),new BMap.Point(112.175012,40.047862));
	try {	
		BMapLib.AreaRestriction.setBounds(map, b);
	} catch (e) {
		alert(e);
	} */
	
	map = new BMap.Map("allmap",{minZoom:7,maxZoom:16,mapType: BMAP_HYBRID_MAP} );
	map.centerAndZoom(new BMap.Point(112.49152,37.383504), 8);
	//getBoundary("山西省");
	map.enableScrollWheelZoom();
	map.addControl(new BMap.MapTypeControl());   //添加地图类型控件
	map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
	var opts;
	var id = 0;
	//loadflag(opts,id);//页面ajax加载
	loadjsonflag();
	function addClickHandler(content,marker){
		marker.addEventListener("click",function(e){
			openInfo(content,e)}
		);
	}
	function openInfo(content,e){
		var p = e.target;
		var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
		var infoWindow = new BMap.InfoWindow(content,opts);  // 创建信息窗口对象 
		map.openInfoWindow(infoWindow,point); //开启信息窗口
	}
	
	
	//添加行政区域
	/*  function getBoundary(name){       
		var bdary = new BMap.Boundary();
		bdary.get(name, function(rs){       //获取行政区域
			map.clearOverlays();        //清除地图覆盖物       
			var count = rs.boundaries.length; //行政区域的点有多少个
			if (count === 0) {
				alert('未能获取当前输入行政区域');
				return ;
			}
          	var pointArray = [];
			for (var i = 0; i < count; i++) {
				var ply = new BMap.Polygon(rs.boundaries[i], {strokeWeight: 2, strokeColor: "#ff0000"}); //建立多边形覆盖物
				map.addOverlay(ply);  //添加覆盖物
				pointArray = pointArray.concat(ply.getPath());
			}    
			map.setViewport(pointArray);    //调整视野    
		});   
	} */

	/* setTimeout(function(){
		getBoundary();
	}, 2000); */
	//ajax加载地图标志
	function loadflag(opts,id){
		$.ajax({
             type: "post",
             dataType:'text',
             data:{"id":id},
             //dataType: "json",//返回json格式的数据
             url: "<s:url value="/"/>/baidumapcontroller/loadCoalDistributionInfo",
            success: function(data){
                /* var data_info = [[113.610001,40.056699,"地址：大同县"],
					 [113.184564,40.044327,"地址：矿区"]
					]; */
					var json =eval('(' + data + ')');
					if(json[0].id!="-1"){
						opts = {
								width : 250,     // 信息窗口宽度
								height: 80,     // 信息窗口高度
								title : "信息窗口" , // 信息窗口标题
								enableMessage:true//设置允许信息窗发送短息
							   };
						for(var i=0;i<json.length;i++){
							//var marker = new BMap.Marker(new BMap.Point(json[i].lng,json[i].lat));  // 创建标注
							var myIcon = new BMap.Icon("http://developer.baidu.com/map/jsdemo/img/fox.gif", new BMap.Size(300,157));
							var marker = new BMap.Marker(pt,{icon:myIcon});  // 创建标注
							var content = json[i].name;
							map.addOverlay(marker);               // 将标注添加到地图中
							addClickHandler(content,marker);
						}
						loadflag(opts,json[0].id);
					}
                }  
              });
		}
	function loadjsonflag(){
		$.getJSON("../resources/coaldistributionjson.json",function(data){
			var json =data;
				 
					  var options = {
					            size: BMAP_POINT_SIZE_BIG,
					            shape: BMAP_POINT_SHAPE_STAR,
					            color: '#b80101'
					        }
					var txt = "";
					  var points = [];
					  var content ="";
					 //alert(""+json.length);
					for(var i=0;i<json.length;i++){
						
						if(json[i].result=="true"){
							content = "企业名称："+json[i].name+"\n";
							content += "最新核定产能量："+json[i].chongxhdcn+"（万吨/年）\n";
							content += "产煤煤种："+json[i].meiz+"\n";
							content += "地址："+json[i].address;
								  var p = new BMap.Point(json[i].lng,json[i].lat);  
						          p.data = content;  
						          points.push(p);  
						} 
						
					}
					 
					   var pointCollection = new BMap.PointCollection(points, options);  // 初始化PointCollection
					   pointCollection.addEventListener('click', function (e) {
					          alert(e.point.data);  // 监听点击事件
					        });
					        map.addOverlay(pointCollection);  // 添加Overlay
		});
	}	
		function loadjsonflag1(){
			$.getJSON("../resources/coaldistributionjson.json",function(data){
				var json =data;
						opts = {
								width : 310,     // 信息窗口宽度
								height: 125,     // 信息窗口高度
								title : "信息窗口" , // 信息窗口标题
								enableMessage:true//设置允许信息窗发送短息
							   };
						var txt = "";
						for(var i=0;i<json.length;i++){
							if(json[i].result=="true"){
								//var marker = new BMap.Marker(new BMap.Point(json[i].lng,json[i].lat));  // 创建标注
								var myIcon = new BMap.Icon("../resources/map/img/yellow_point.png", new BMap.Size(30,30));
								var marker = new BMap.Marker(new BMap.Point(json[i].lng,json[i].lat),{icon:myIcon});  // 创建标注
								var content = "企业名称："+json[i].name+"<br>";
								content += "最新核定产能量："+json[i].chongxhdcn+"（万吨/年）<br>";
								content += "产煤煤种："+json[i].meiz+"<br>";
								content += "地址："+json[i].address;
								//marker.enableDragging();
								map.addOverlay(marker);               // 将标注添加到地图中
								addClickHandler(content,marker);
							}else{
								txt += json[i].name+" || ";
							}
							
						}
						$("#falseload").val(txt);
						
			});
		}
		
		
</script>


<!---悬浮筛选部分 开始------------>
<div class="mapL"> 
  <!--框1-->
  <div class="mapLT"> 
    <!--搜索框-->
    <div class="search">
      <input name="mc" id="mc" class="s-text" type="text" value="请输入关键字"  onfocus="this.value=''" onblur="if(this.value==''){this.value='请输入关键字'}" >
      <input name="an" type="button" class="s-button"  onclick="cx()">
      <INPUT TYPE="hidden" NAME="ssjt" id="ssjt">
      <INPUT TYPE="hidden" NAME="mzpz" id="mzpz">
      <INPUT TYPE="hidden" NAME="mklb" id="mklb">
      
      <INPUT TYPE="hidden" NAME="mkcn" id="mkcn">
      <INPUT TYPE="hidden" NAME="cmff" id="cmff">
      <INPUT TYPE="hidden" NAME="tffs" id="tffs">
      <INPUT TYPE="hidden" NAME="ktfs" id="ktfs">
      
      <div class="clear"></div>
    </div>
    <!--行-->
    <div class="d-line"> 
      <!--销往地区-->
      <div class="drop1">
        <div class="select-box"><span>所在地区</span></div>
        <div class="select-down place-choice w-left10 d-gray">
          <ul class="list1">
            <li class="list1-li"><span><a href="">全部</a></span><span>北京</span>
              <div class="list2"><i><a href="">北京</a></i>
                <ul>
				   
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <div class="clear"></div>
                </ul>
              </div>
            </li>
            <li class="list1-li"><span>天津</span><span>河北</span>
              <div class="list2"> <i>天津</i>
                <ul>
                  <li><a href="">朝阳朝阳朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <div class="clear"></div>
                </ul>
                <div class="hengxian"></div>
                <i>河北</i>
                <ul>
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <li><a href="">海淀</a></li>
                  <li><a href="">丰台</a></li>
                  <li><a href="">朝阳</a></li>
                  <div class="clear"></div>
                </ul>
              </div>
            </li>
            <li class="list1-li"><span>山西</span><span>内蒙古</span></li>
            <li class="list1-li"><span>辽宁</span><span>吉林</span></li>
            <li class="list1-li"><span>黑龙江</span><span>上海</span></li>
            <li class="list1-li"><span>江苏</span><span>浙江</span></li>
            <li class="list1-li"><span>安徽</span><span>福建</span></li>
            <li class="list1-li"><span>江西</span><span>山东</span></li>
            <li class="list1-li"><span>河南</span><span>湖北</span></li>
            <li class="list1-li"><span>湖南</span><span>广东</span></li>
            <li class="list1-li"><span>广西</span><span>海南</span></li>
            <li class="list1-li"><span>重庆</span><span>四川</span></li>
            <li class="list1-li"><span>贵州</span><span>云南</span></li>
            <li class="list1-li"><span>西藏</span><span>陕西</span></li>
            <li class="list1-li"><span>甘肃</span><span>青海</span></li>
            <li class="list1-li"><span>宁夏</span><span>新疆</span></li>
          </ul>
        </div>
      </div>    

      <!--竖线-->
      <div class="shuxian"></div>
      <!--五大集团-->
      <div class="drop1">
        <div class="select-box"><span>所属集团</span></div>
        <div class="select-down b-choice w-right5 d-gray" style="width:190px;">
          <ul>
            <li  > <em  ></em> <a  data_id="ssjt1"  href="javascript:void(0)" >大同煤矿集团</a></li>
            <li> <em></em> <a data_id="ssjt2"  href="javascript:void(0)">晋煤集团</a></li>
            <li> <em></em> <a data_id="ssjt3"  href="javascript:void(0)">潞安集团</a></li>
            <li> <em></em> <a data_id="ssjt4" href="javascript:void(0)">山西焦煤集团</a></li>
            <li> <em></em> <a data_id="ssjt5" href="javascript:void(0)">阳煤集团</a></li>
          </ul>
        </div>
      </div>
      <!--竖线-->
      <div class="shuxian"></div>
      <!--区域-->
      <div class="drop1">
        <div class="select-box"><span>煤矿类别</span></div>
        <div class="select-down a-choice w-left10 d-gray" style="width:120px;">
          <ul>
            <li><a data_id="mklb1" href="javascript:void(0)">全部</a></li>
            <li><a  data_id="mklb1" href="javascript:void(0)">地方煤炭企业</a></li>
            <li><a data_id="mklb1" href="javascript:void(0)">国有重点煤炭企业</a></li>
            
          </ul>
        </div>
      </div>
      <div class="clear"></div>
    </div>
 
    <!--行-->
    <div class="d-line"> 
      <!--产能-->
      <div class="drop2">
        <div class="select-box"><span>产能</span></div>
        <div class="select-down a-choice w-left d-white" style="width:226px;">
          <ul>
            <li><a data_id="mkcn1" href="javascript:void(0)">不限</a></li>
            <li><a data_id="mkcn1" href="javascript:void(0)" >小于100万吨</a></li>
            <li><a data_id="mkcn1" href="javascript:void(0)">100-300万吨</a></li>
            <li><a data_id="mkcn1" href="javascript:void(0)">300-500万吨</a></li>
            <li><a data_id="mkcn1" href="javascript:void(0)">大于500万吨</a></li>
          </ul>
          <!--<div class="cn-price">
            <input id="priceBegTxt" type="text">
            &nbsp;-&nbsp;
            <input id="priceEndTxt" t="" type="text">
            万吨
            <input id="priceInputBtn" type="button" value="确定">
          </div>-->
        </div>
      </div>
      <!--间隔-->
      <div class="jiange"></div>
      <!--煤炭产品-->
      <div class="drop2">
        <div class="select-box"><span>煤炭产品</span></div>
        <div class="select-down b-choice w-left d-white" style="width:120px;">
          <ul>
         
            <li> <em></em> <a data_id="mzpz1" href="javascript:void(0)">无烟煤</a></li>
            <li> <em></em> <a data_id="mzpz2"  href="javascript:void(0)">贫瘦煤</a></li>
            <li> <em></em> <a data_id="mzpz3"  href="javascript:void(0)">瘦煤</a></li>
            <li> <em></em> <a data_id="mzpz4"  href="javascript:void(0)">焦煤</a></li>
            <li> <em></em> <a data_id="mzpz5"  href="javascript:void(0)">肥煤</a></li>
            <li> <em></em> <a data_id="mzpz6"  href="javascript:void(0)">烟煤</a></li>
            <li> <em></em> <a data_id="mzpz7"  href="javascript:void(0)">粘煤</a></li>
             <li> <em></em> <a data_id="mzpz8"  href="javascript:void(0)">动力煤</a></li>
              <li> <em></em> <a data_id="mzpz9"  href="javascript:void(0)">气煤</a></li>
               <li> <em></em> <a data_id="mzpz10"  href="javascript:void(0)">1/3焦煤</a></li>
                <li> <em></em> <a data_id="mzpz11"  href="javascript:void(0)">气焰煤</a></li>
          </ul>
        </div>
      </div>
	
      <!--间隔-->
      <div class="jiange"></div>
      <!--目前状况-->
      <div class="drop2">
        <div class="select-box"><span>采煤方法</span></div>
        <div class="select-down a-choice w-left d-white" style="width:120px;">
          <ul>
            <li><a data_id="cmff1"  href="javascript:void(0)" >不限</a></li>
            <li><a data_id="cmff1"  href="javascript:void(0)"   >综采</a></li>
            <li><a data_id="cmff1"  href="javascript:void(0)"  >普采</a></li>
            <li><a data_id="cmff1"  href="javascript:void(0)"  >露采</a></li>
            <li><a data_id="cmff1"  href="javascript:void(0)"  >混合</a></li>
            <li><a data_id="cmff1"  href="javascript:void(0)"  >长壁</a></li>
          </ul>
        </div>
      </div>
      <!--间隔-->
      <div class="jiange"></div>
      <!--更多条件-->
      <div class="drop2">
        <div class="select-box"><span>更多条件</span></div>
        <div class="select-down more-choice w-right d-white" style="width:350px;">
          <div class="list"><span>通风方式</span>
            <ul>
              <li><a data_id="tffs1"  href="javascript:void(0)" >全部</a></li>
              <li><a data_id="tffs1"  href="javascript:void(0)" >中央并列</a></li>
              <li><a data_id="tffs1"  href="javascript:void(0)" >中央分裂</a></li>
              <li><a data_id="tffs1"  href="javascript:void(0)" >抽出</a></li>
              <li><a data_id="tffs1"  href="javascript:void(0)" >对角</a></li>
              <li><a data_id="tffs1"  href="javascript:void(0)" >分区</a></li>
               <li><a data_id="tffs1"  href="javascript:void(0)" >混合</a></li>
              <div class="clear"></div>
            </ul>
            <div class="clear"></div>
          </div>
          <div class="list"><span>开拓方式</span>
            <ul>
              <li><a data_id="ktfs1"  href="javascript:void(0)" >全部</a></li>
              <li><a data_id="ktfs1"  href="javascript:void(0)" >露天开拓</a></li>
              <li><a data_id="ktfs1"  href="javascript:void(0)" >立井开拓</a></li>
              <li><a data_id="ktfs1"  href="javascript:void(0)" >平峒</a></li>
              <li><a data_id="ktfs1"  href="javascript:void(0)" >斜井开拓</a></li>
              <li><a data_id="ktfs1"  href="javascript:void(0)" >混合开拓</a></li>
              <div class="clear"></div>
            </ul>
            <div class="clear"></div>
          </div>
          
        </div>
      </div>
      <div class="clear"></div>
    </div>
  </div>
  <!--框2-->
  <div class="mapLS"> 
    <!--筛选结果-->
    <div class="searchresult">
      <div class="pricetrends">
        <!-- <h3><span>60349</span>元/㎡</h3> -->
      </div>
      <div class="resulticon"></div>
      <div class="pricenum">
        <h3>煤矿</h3>
        <p>共<span id="mkjg"></span>个结果</p>
      </div>
      <div class="clear"></div>
    </div>
    <!--结果详情-->
    <div class="resultlist" style="height:379px;">
      <div id="cont_Ov">
        <div style="overflow:hidden;">
          <ul class="list-xq">
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
            <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>
          </ul>
        </div>
        <!--底部空白区域-->
        <div style="height:20px;width:100%;"></div>
      </div>
    </div>
    <!--底部箭头--> 
    <!--上箭头-->
    <div class="arrow-up"></div>
    <!--下箭头--<div class="arrow-down"></div>-->
    
    <div class="clear"></div>
  </div>
</div>
  <SCRIPT LANGUAGE="JavaScript">
    <!--
 var ssjt = [];
 var mzpz = [];
    

Array.prototype.indexOf = function(val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
}
return -1;
};
 
function removeByValue(arr, val) {
  for(var i=0; i<arr.length; i++) {
    if(arr[i] == val) {
      arr.splice(i, 1);
      break;
    }
  }
}


$('.d-line li').click(function(){
	document.getElementById("yxtj").style.display ="block";
   // alert($(this).html());  
  if(!$(this).is('.list1-li')){
//alert($(this).find('em').attr('class'));
   //if($(this).find('em')== undefined && $(this).find('em')==null ){
    if(!$(this).is(':has(em)')){
    
		   $(this).parent().find('li a').css("color","#333");
		   $(this).find('a').css("color","red");
		   $("#"+$(this).find('a').attr("data_id")).remove();

		   if($(this).find('a').text()!="全部"  && $(this).find('a').text()!="不限"){

		     // $("#tj").append("<li id='"+$(this).find('a').attr("data_id")+"'><a href=''>"+$(this).find('a').text()+"</a><b></b></li>"); 
		      $("#tj").append("<li id='"+$(this).find('a').attr("data_id")+"'><a href=javascript:scbq('"+$(this).find('a').attr("data_id")+"')>"+$(this).find('a').text()+"</a><b></b></li>"); 
		       
		     
		   }
		   $("#"+$(this).find('a').attr("data_id").substring(0,4)).val($(this).find('a').text());
// alert($(this).find('a').text());
    }else{//多选情况
 		if($(this).find('em').attr('class')=="e-check"){
			 //如果选择了删除选择
 			 $(this).find('em').removeClass("e-check");
			 //删除选择条件已经选择的
			 $("#"+$(this).find('a').attr("data_id")).remove();
			 //删除选择数组
			if($(this).find('a').attr("data_id").substring(0,4)=="ssjt"){
			  removeByValue(ssjt,"'"+$(this).find('a').text()+"'");
			  $("#ssjt").val(ssjt.toString());
			}
			if($(this).find('a').attr("data_id").substring(0,4)=="mzpz"){
				  removeByValue(mzpz,"'"+$(this).find('a').text()+"'");
				  $("#mzpz").val(mzpz.toString());
				}			 
			
		}else{
			  //把对勾打上
			  $(this).find('em').addClass("e-check");
			  //删除了这个类别data_id已经选择了的
			  $("#"+$(this).find('a').attr("data_id")).remove();
			  //添加标签到选择条件
			  $("#tj").append("<li id='"+$(this).find('a').attr("data_id")+"'><a href=javascript:scbq('"+$(this).find('a').attr("data_id")+"')>"+$(this).find('a').text()+"</a><b></b></li>"); 
	          //往数组里压数据 首先判断里面有没有  
	          if($(this).find('a').attr("data_id").substring(0,4)=="ssjt"){
			  if( ssjt.indexOf("'"+$(this).find('a').text()+"'")){
				  ssjt.push("'"+$(this).find('a').text()+"'");
				  $("#ssjt").val(ssjt.toString());
			   }
			  }
	          if($(this).find('a').attr("data_id").substring(0,4)=="mzpz"){
				  if( mzpz.indexOf("'"+$(this).find('a').text()+"'")){
					  mzpz.push("'"+$(this).find('a').text()+"'");
					  $("#mzpz").val(mzpz.toString());
				   }
				  }	          
	          
	          //alert(ssjt.toString());  
		}
		 
 

}
    
    cx();
 //$(".list-xq").empty();
//alert($(".list-xq").html());
 //$(".list-xq").append(' <li><a href=""><span class="floatl">朝阳</span><span class="floatr num">100万</span></a></li>');
}
}); 

function scbq(id){
	// alert(id);
	 $("#"+id).remove();
	  $("a[data_id='"+id+"']").parent().find('em').removeClass("e-check");
	  $("a[data_id='"+id+"']").css("color","#333");
	  
	  $("#"+$("a[data_id='"+id+"']").attr("data_id").substring(0,4)).val("");
	  
	  var ids=""+id;
		if(ids.substring(0,4)=="ssjt"){
			  removeByValue(ssjt,"'"+$("a[data_id='"+id+"']").text()+"'");
			  $("#ssjt").val(ssjt.toString());
			}
			if(ids.substring(0,4)=="mzpz"){
				  removeByValue(mzpz,"'"+$("a[data_id='"+id+"']").text()+"'");
				  $("#mzpz").val(mzpz.toString());
			}
			//$("#"+$(this).find('a').attr("data_id")).val($(this).find('a').text());	
	cx();			
}

    //-->
    </SCRIPT>   
<div class="marR"> 
  <!--条件框-->
 <!--  <div class="condition"><em class="e-check"></em><a href="">移动地图时搜索</a>
    <div class="clear"></div>
  </div>
  <div class="condition"><em></em><a href="">移动地图时搜索</a>
    <div class="clear"></div>
  </div> -->
  <div  id="yxtj"   style="display:none;" class="condition"> <i>已选条件：</i>
    <ul id="tj">
      <!-- <li><a href="">太原市</a><b></b></li>
      <li><a href="">无烟煤</a><b></b></li> -->
    </ul>
    <div class="qingkong"><a href="">清空</a></div>
    <div class="clear"></div>
  </div>
</div>
<script>
var get = {
	byId : function(id){
		return typeof id === "string" ? document.getElementById(id) : id;},
	sty : function(obj,name){
		return obj.currentStyle ? obj.currentStyle[name] : getComputedStyle(obj, null)[name];},
	obx_H : function(obj){
		var obj = obj.getBoundingClientRect();
		return obj.bottom - obj.top;},
	ScoTop : function(){
		return document.documentElement.scrollTop || document.body.scrollTop;}
	};

function enclose(con_Ov, con_Ov_H, con, con_H, scool,scool_H){
    var isFirefox = (navigator.userAgent.indexOf("Gecko") !== -1);
    if(document.onwheel !== undefined){
	con_Ov.onwheel = wheelHandler;
	}else if(document.onmousewheel !== undefined){
		con_Ov.onmousewheel = wheelHandler;
		}else if(isFirefox){
		con_Ov.addEventListener("DOMMouseScroll", wheelHandler, false);
		}
	
	function wheelHandler(e){
		var e = e || window.event,
		deltaY = e.wheelDeltaY || (e.wheelDeltaY===undefined && e.wheelDelta) || e.deltaY*-1 || e.detail*-1 || 0,
		con_Top,// = parseFloat(get.sty(con,"top")),
		con_MaxH = con_H - con_Ov_H, //内容的最大滚动距离
		scool_MaxH =con_Ov_H - scool_H,//左侧最大滚动距离
		gd_Auto,//滚动设置的Interval对象
		star_Time = 0, //滚动开始时间
		now_Time = 0,//滚动结束时间
		step = 10; //每次滚动多少像素
		if(gd_Auto){clearInterval(gd_Auto);}
		star_Time = new Date().getTime();
		if(deltaY < 0){
			gd_Auto = setInterval(function(){
			con_Top = parseFloat(get.sty(con,"top")),
			now_Time = new Date().getTime();
				
			if(con_Top <= -con_MaxH){
			clearInterval(gd_Auto);
			con.style.top = - con_MaxH + "px";
			scool.style.top = scool_MaxH + "px";
			return;
			}
				
			con.style.top = con_Top - step +"px";
			scool.style.top = Math.round(-(con_Top-step)/con_MaxH*scool_MaxH) + "px";
				
			if(con_Top - step <= -con_MaxH || now_Time - star_Time > 100){
			clearInterval(gd_Auto);
			con_Top - step <= -con_MaxH && (con.style.top = - con_MaxH + "px",scool.style.top = scool_MaxH + "px");		
			return;			
			}
		},20)
			
	}else if(deltaY > 0){
		gd_Auto = setInterval(function(){
		con_Top = parseFloat(get.sty(con,"top")),
		now_Time = new Date().getTime();
		if(con_Top >= 0){
			clearInterval(gd_Auto);
			con.style.top = 0 + "px";
			scool.style.top = 0 + "px";
			return;
			}
					
		con.style.top = con_Top + step +"px";
		scool.style.top = Math.round(-(con_Top+step)/con_MaxH*scool_MaxH) + "px";
					
		if(con_Top + step >= 0 || now_Time - star_Time > 200){
		clearInterval(gd_Auto);
		con_Top + step >= 0 && (con.style.top = 0 + "px",scool.style.top = 0 + "px");		
		return;	
		}					
		},20)
			}else{
			alert("错误！");
			}
		
	if(e.stopPropagation) e.stopPropagation(); 
    		else e.cancelBubble = true;  
    	if(e.preventDefault) e.preventDefault();
    		else e.returnValue = false;   
	}
}

function drag(con_Ov, con_Ov_H, con, con_H, ele, ele_H, e){
	var e = e || window.event,
	scroll_T = get.ScoTop(),
	sc_H = con_Ov_H - ele_H,
    	startY = e.clientY + scroll_T,
    	origY = ele.offsetTop,
    	deltaY = startY - origY;
		
    if(document.addEventListener){
        document.addEventListener("mousemove", moveHandler, true);
        document.addEventListener("mouseup", upHandler, true);
    	}else if(document.attachEvent){  // IE Event Model for IE5-8
		ele.setCapture();
		ele.attachEvent("onmousemove", moveHandler);
		ele.attachEvent("onmouseup", upHandler);
		ele.attachEvent("onlosecapture", upHandler);
    	}
		
    if(e.stopPropagation) e.stopPropagation(); 
    	else e.cancelBubble = true;  
    if(e.preventDefault) e.preventDefault();
    	else e.returnValue = false;                    

    function moveHandler(e) {
        var e = e || window.event,
	ele_Top = Math.max(e.clientY + scroll_T - deltaY,0) && Math.min(e.clientY + scroll_T - deltaY,sc_H),
	con_Top = -ele_Top/sc_H*(con_H - con_Ov_H);
			
        ele.style.top = ele_Top + "px";
	con.style.top = con_Top + "px";
		
        if(e.stopPropagation) e.stopPropagation();
        else e.cancelBubble = true;
    }

    function upHandler(e){
    	var e = e || window.event;
        if(document.removeEventListener){
            document.removeEventListener("mouseup", upHandler, true);
            document.removeEventListener("mousemove", moveHandler, true);
        }else if(document.detachEvent){
            ele.detachEvent("onlosecapture", upHandler);
            ele.detachEvent("onmouseup", upHandler);
            ele.detachEvent("onmousemove", moveHandler);
            ele.releaseCapture();
        	}
        if(e.stopPropagation) e.stopPropagation();
        	else e.cancelBubble = true;
    }
}

function jsScroll(idName,height,clName01,clName02){
	var con_Ov = get.byId(idName),
	con_Ov_Height = parseFloat(get.sty(con_Ov,"height")),
	cont = con_Ov.getElementsByTagName("div")[0],
	cont_H = Math.round(get.obx_H(cont));

	if(!con_Ov_Height || con_Ov_Height == "auto" || con_Ov_Height>=height){
		con_Ov.style.height = height+"px";
		con_Ov.style.overflow = "hidden";
		con_Ov_Height = height;
		}	
	
	if(cont_H<=con_Ov_Height) return;
	cont.style.position = "relative";//设置内容必要CSS样式；
	cont.style.top = "0px";
	cont.style.zIndex = "0";
			
	var scool = document.createElement("div"),scool_An = document.createElement("div");//添加滚动条
	if(clName01){
		scool.className = clName01;
		}else{
			scool.style.cssText = "position:absolute; top:0; right:0; z-index:99; width:10px; background-color:#ccc;";
			}
	scool.style.height = con_Ov_Height + "px";
	con_Ov.appendChild(scool);
	if(clName02){
		scool_An.className = clName02;
		}else{
			scool_An.style.cssText = "position:absolute; top:0; right:0; z-index:999; width:10px; height:30px; background-color:#999;";
			}
	con_Ov.appendChild(scool_An);
	
	var scool_AnH = parseFloat(get.sty(scool_An,"height"));
	scool_An.onmousedown = function(e){
		drag(con_Ov,con_Ov_Height,cont,cont_H,this,scool_AnH,e);
		}
	enclose(con_Ov,con_Ov_Height,cont,cont_H,scool_An,scool_AnH);
}
                            
jsScroll("cont_Ov",379,"scool","scool_An"); 




function cx(){
	 
		$.ajax( {
		    type : "POST",
		    dataType: "json",
		    url : "<s:url value="/"/>baidumapcontroller/getCoalList",  
		    data: {"mc":$("#mc").val(), "ssjt":$("#ssjt").val(),"mzpz":$("#mzpz").val(),"mklb":$("#mklb").val(),"mkcn":$("#mkcn").val(),"cmff":$("#cmff").val(),"tffs":$("#tffs").val(),"ktfs":$("#ktfs").val()}, 
		    
		 
		    
		    success : function(data){  
		    //	var json = eval('(' + data + ')');
		   // var json = eval('(' + data + ')');
	  //  alert(fff);
		      var fff="";
		   $(".list-xq").empty();
		    //alert($(".list-xq").html());
		    $("#mkjg").html(data.length);;
////////
map.clearOverlays();
map.centerAndZoom(new BMap.Point(112.49152,37.383504), 8);
		    var options = {
		            size: BMAP_POINT_SIZE_BIG,
		            shape: BMAP_POINT_SHAPE_STAR,
		            color: '#b80101'
		        }
		var txt = "";
		  var points = [];
		  var content ="";
		 //alert(""+json.length);
	 
			
	
	 
		 
	
////////////
		      for(var i=0;i<data.length;i++){
			   var obj=data[i];
			    if(i<25){
			   // fff=fff+obj.id+"-";
			      $(".list-xq").append(" <li><a href='javascript:dwcha("+obj.lng+","+obj.lat+");'><span class='floatl'>"+obj.meikmc+"</span><span class='floatr num'>"+obj.chongxhdcn+"</span></a></li>");
			      } 
			    
			    if(obj.lng.length>3 && obj.lat.length>3 ){
					content = "企业名称："+obj.name+"\n";
					content += "最新核定产能量："+obj.chongxhdcn+"（万吨/年）\n";
					content += "产煤煤种："+obj.meiz+"\n";
					content += "地址："+obj.address;
						  var p = new BMap.Point(obj.lng,obj.lat);  
				          p.data = content;  
				          points.push(p);  
			    }
				
		       }
		     // alert(fff);
		     ///////////
		   	   var pointCollection = new BMap.PointCollection(points, options);  // 初始化PointCollection
		   pointCollection.addEventListener('click', function (e) {
		          alert(e.point.data);  // 监听点击事件
		        });
		        map.addOverlay(pointCollection);  // 添加Overlay
		   ////////////     
		        
		    },
		    error : function()
		    {
		        alert("加载失败");
		    }
		});
	}
 function dwcha(j,w){
	 
	 map.centerAndZoom(new BMap.Point(j,w), 20); 
 }
 cx();
</script> 
<!---悬浮筛选部分 结束------------>

</body>
</html>
